import react from "react";

export default class Tests extends react.Component {
  constructor() {
    super()
    this.state = {
      count: 0 
    }
    console.log('constructor~~')
  }
  btnClick = () => {
    this.setState({
      count: this.state.count + 1
    })
  }
  render() {
    console.log('render~~')

    return (
      <div>
        <h1>{this.state.count}</h1>
        <button onClick={() => this.btnClick()}>add</button>
      </div>
    )
  }

  componentDidMount() {
    console.log('componentDid Mount~~~')
  }

  componentDidUpdate() {
    console.log('componentDid update~~~')
  }

  componentWillUnmount() {
    console.log('componentDid will unMount~~~')
  }
}